<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        body>div{
            margin: 0 auto;
        }

    </style>
</head>
<body>
<div id="app">
    <el-container>
        <el-header style=" width: 100%;padding: 0; height: 150px;">
            <!--导航菜单开始-->
            <div style="background-color: black;">
                <el-menu style="width: 1200px;margin: 0 auto;height: 100px;"
                         :default-active="activeIndex"
                         class="el-menu-demo"
                         mode="horizontal"
                         @select="handleSelect"
                         background-color="black"
                         text-color="#fff"
                         active-text-color="#fff">

                    <a href=""><img src="imgs/logo.png"style="width: 40px;height: 40px;
                    float: left; margin-top:25px;margin-left: 320px;
                    vertical-align: middle" alt="YxMall商城官网"></a>
                    <div style="float: right;position: relative;top: 30px;right: 500px">
                        <el-input placeholder="请输入商品信息" v-model="wd">
                            <el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
                        </el-input>
                    </div>

                    <a href=""style="text-decoration: none;color:white;float: right;position: relative;
                        margin-top:35px;right: 150px;line-height: 30px">全部商品</a>

                    <div style="float: right;position: relative;top:25px">

                        <a href=""><img src="imgs/1.jpg"  alt=""></a>
                        <a href="javascript:void(0)"><img src="imgs/2.jpg"  alt=""></a>
                    </div>

                </el-menu>
            </div>
        </el-header>






    </el-container>

</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: "#app",
        data: function () {
            return {
                activeIndex:'',
                wd:'',
                currentIndex: "1-1",
                categoryArr: [],
                bannerArr: [{url:"imgs/1.jpg"},{url:"imgs/2.jpg"}],
                productArr: [{id:"1",url:"imgs/4.jpg",title:"1",price:"1",viewCount:"1",saleCount:"1"},{id:"1",url:"imgs/4.jpg",title:"1",price:"1",viewCount:"1",saleCount:"1"},{id:"1",url:"imgs/4.jpg",title:"1",price:"1",viewCount:"1",saleCount:"1"},{id:"1",url:"imgs/4.jpg",title:"1",price:"1",viewCount:"1",saleCount:"1"},{id:"1",url:"imgs/4.jpg",title:"1",price:"1",viewCount:"1",saleCount:"1"},{id:"1",url:"imgs/4.jpg",title:"1",price:"1",viewCount:"1",saleCount:"1"}],
                user: {},

            }
        },
        methods: {
            handleSelect(key, keyPath) {
                if (key == '1-2') {
                    let name = prompt("请输入分类的名称");
                    if (name == null) {
                        return;
                    }
                    if (name == '') {
                        v.$message.error("分类名称不能为空");
                        return;
                    }

                }
            }
        }
    })
</script>
</html>